﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="保护器入库单.aspx.cs" Inherits="syc.Fc.保护器入库单" %>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
SelectCommand="select @日期=t1.日期,@铁质供货=t2.名称,@塑质供货=t3.名称
,@套数=t1.套数,@件数=t1.件数,@检验员=t1.检验员,@备注=t1.备注
,@判定结论=t1.判定结论,@判定员=t1.判定员,@制票=t1.制票,@合格=t1.合格
from 自产保护器判定单 t1
left outer join 原料供货单位 t2 on t2.ID=t1.铁质供货商ID
left outer join 材料供货单位 t3 on t3.ID=t1.塑质供货商ID
where t1.ID=@ID"
 UpdateCommand="if @合格=1 begin Update 自产保护器判定单 set 判定员=@判定员,判定结论='合格入库',合格=1 where ID=@ID; end
else begin Update 自产保护器判定单 set 判定员=@判定员,判定结论=null,合格=0 where ID=@ID; end"
ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    onselected="SqlDataSource1_Selected" >
<SelectParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" />
<asp:Parameter Name="日期" DbType="Date" Size="3" Direction="Output" />
<asp:Parameter Name="铁质供货" DbType="String"  Size="100" Direction="Output"  />
<asp:Parameter Name="塑质供货" DbType="String"  Size="100" Direction="Output"  />
<asp:Parameter Name="套数" DbType="Int32" Size="4" Direction="Output" />
<asp:Parameter Name="件数" DbType="Int32" Size="4"  Direction="Output" />
<asp:Parameter Name="检验员" DbType="String"  Size="20" Direction="Output"  />
<asp:Parameter Name="备注" DbType="String"  Size="40" Direction="Output"  />
<asp:Parameter Name="判定结论" DbType="String"  Size="100" Direction="Output"  />
<asp:Parameter Name="判定员" DbType="String"  Size="20" Direction="Output"  />
<asp:Parameter Name="制票" DbType="String"  Size="20" Direction="Output"  />
<asp:Parameter Name="合格" DbType="Boolean" Size="1" Direction="Output"  />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="ID" DbType="Int32" Size="4" />
<asp:Parameter Name="判定员" DbType="String"  Size="20"  />
<asp:Parameter Name="合格" DbType="Boolean" Size="1" />
</UpdateParameters>
</asp:SqlDataSource>


<asp:Label ID="BillID" runat="server" Text="0" Visible="False"></asp:Label>


<div id="wintop" class="wintop">螺纹保护器 产品判定入库通知书</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_Check" runat="server" Text="" CssClass="button" 
        onclick="Button_Check_Click" />
    <input type="button" value="导出Excel" class="button" onclick="Export();" />
    <input type="button" value="关 闭" class="button" onclick="parent.swin2_close();" />
</asp:Panel>
<script>    putBillHead();</script>

<style>
td.rim{border:0.5pt solid #000000;font-size:11pt;text-align:center;}
</style>
<table id=mt border=0 cellpadding=0 style=border-collapse:collapse;>
<tr>
<td colspan=6 style=font-size:16pt;height:30pt;border:none;text-align:center;><b>产品判定入库通知书</b></td>
</tr>
<tr>
<td class=rim style=width:65pt;height:23pt;>产品类别</td>
<td class=rim style=width:105pt;>螺纹保护器</td>
<td class=rim style=width:74pt;>规 格</td>
<td class=rim style=width:74pt;>5 - 1/2&quot;</td>
<td class=rim style=width:74pt;>螺纹形式</td>
<td class=rim style=width:74pt;>LC</td>
<!--td style=width:19pt;border:none;text-align:center;font-size:10pt; rowspan=7>#*#*#</td-->
</tr>
<tr>
<td class=rim style=height:23pt;>日 期</td>
<td class=rim><asp:Label ID="Date1" runat="server" Text=""></asp:Label></td>
<td class=rim>执行标准</td>
<td class=rim colspan=3>API Spec5CT</td>
</tr>
<tr>
<td class=rim colspan=2 style=height:23pt;>原料供应商</td>
<td class=rim>套 数</td>
<td class=rim>件 数</td>
<td class=rim>检验员</td>
<td class=rim>备 注</td>
</tr>
<tr>
<td class=rim style=height:23pt;>铁 质</td>
<td class=rim><asp:Label ID="TieZhi" runat="server" Text=""></asp:Label></td>
<td class=rim rowspan=2><asp:Label ID="TaoShu" runat="server" Text=""></asp:Label></td>
<td class=rim rowspan=2><asp:Label ID="JianShu" runat="server" Text=""></asp:Label></td>
<td class=rim rowspan=2><asp:Label ID="ZhiJianYuan" runat="server" Text=""></asp:Label></td>
<td class=rim rowspan=2><asp:Label ID="BeiZhu" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td class=rim style=height:30px;>塑 质</td>
<td class=rim><asp:Label ID="SuZhi" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td class=rim rowspan=2>判定结论</td>
<td class=rim rowspan=2 colspan=3><asp:Label ID="JieLun" runat="server" Text=""></asp:Label></td>
<td class=rim style=height:32px;>判定员</td>
<td class=rim><asp:Label ID="PanDing" runat="server" Text=""></asp:Label></td>
</tr>
<tr>
<td class=rim style=height:23pt;>制 票</td>
<td class=rim><asp:Label ID="ZhiPiao" runat="server" Text=""></asp:Label></td>
</tr>
</table>

<div style="text-align:right;height:105px;margin-top:-80px;">
<asp:Image ID="PDZ" runat="server" ImageUrl="/images/pdz.png" />
</div>
<script>putBillFoot();</script>

</form>

<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="判定入库通知书.xls" />
<input type="hidden" name="content" value="" />
</form>


<script>
    var textboxs = document.getElementsByTagName("input");
    for (var i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }

    //导出Excel
    function Export() {
        var ss = document.getElementById("mt").tBodies[0].innerHTML.replace("!--", "").replace("--", "");
        form2.content.value =
"<html xmlns:o='urn:schemas-microsoft-com:office:office'\nxmlns:x='urn:schemas-microsoft-com:office:excel'\nxmlns='http://www.w3.org/TR/REC-html40'>\n<head>\n<meta http-equiv=Content-Type content='text/html; charset=utf-8'>\n<style>\n<!--table\n@page\n{mso-header-data:;\nmso-footer-data:;\nmargin:.79in .31in .79in .31in;\nmso-header-margin:.51in;\nmso-footer-margin:.51in;\nmso-horizontal-page-align:center;\n}\nbr{mso-data-placement:same-cell;}\ntd.rim{border:0.5pt solid #000000;font-size:11pt;text-align:center;}\n-->\n</style>"
+ "\n<!--[if gte mso 9]><xml>\n<x:ExcelWorkbook>\n<x:ExcelWorksheets>\n<x:ExcelWorksheet>\n<x:Name>判定入库通知书</x:Name>\n<x:WorksheetOptions>\n<x:ShowPageBreakZoom/>\n<x:PageBreakZoom>100</x:PageBreakZoom>\n<x:DefaultRowHeight>285</x:DefaultRowHeight>\n<x:Print>\n<x:ValidPrinterInfo/>\n<x:Scale>100</x:Scale>\n<x:PaperSizeIndex>9</x:PaperSizeIndex>\n<x:HorizontalResolution>200</x:HorizontalResolution>\n<x:VerticalResolution>200</x:VerticalResolution>\n</x:Print>\n<x:Selected/>\n<x:Panes>\n<x:Pane>\n<x:Number>3</x:Number>\n<x:ActiveRow>0</x:ActiveRow>\n<x:ActiveCol>0</x:ActiveCol>\n</x:Pane>\n</x:Panes>\n</x:WorksheetOptions>"
+ "\n<x:PageBreaks>\n<x:RowBreaks>\n<x:RowBreak>\n<x:Row>17</x:Row>\n</x:RowBreak>\n</x:RowBreaks>\n</x:PageBreaks>\n</x:ExcelWorksheet>\n</x:ExcelWorkbook>\n</xml><![endif]-->\n</head>\n<body>"
+ "<table style=border-collapes:collapse border=0 cellpadding=0>"
+ ss.replace("#*#*#", "第<br>一<br>联<br><br>生<br>产<br>处")
+ "<tr><td colspan=7 style=height:90pt></td></tr>"
+ ss.replace("#*#*#", "第<br>二<br>联<br><br>质<br>检<br>处")

+ ss.replace("#*#*#", "第<br>三<br>联<br><br>-<br>-<br>处")
+ "<tr><td colspan=7 style=height:90pt></td></tr>"
+ ss.replace("#*#*#", "第<br>四<br>联<br><br>-<br>-<br>处")
+"</table></body></html>";
        form2.submit();
    }

    
</script>
</body>
</html>